{template "header.html", "/"}

<div class="page-container">
    <div class="page-content-wrapper">
        {template "header.html"}
        <div class="page-content">
            <div class="container">

                <ul class="page-breadcrumb breadcrumb">
                    <li>
                        <a href="{SITE_URL}">首页</a>
                        <i class="fa fa-circle"></i>
                    </li>
                    <li>
                        <a href="{MODULE_URL}">{MODULE_NAME}</a>
                        <i class="fa fa-circle"></i>
                    </li>
                    {dr_catpos($catid, '', true, '<li><a href="{url}">{name}</a><i class="fa fa-circle"></i></li>')}
                    <li>
                        <span>搜索：{$keyword}</span>
                    </li>
                </ul>

                <div class="page-content-inner">
                    <div class="search-page search-content-1">
                        <div class="portlet light ">
                            <p style="line-height:30px">
                                <strong>栏目分类：</strong>
                                <a class="label {if !$catid || $cat.child}label-success{else}label-default{/if}" href="{dr_search_url($params, 'catid', NULL)}">不限</a>
                                <!--调用栏目分类，这种用法只能用于模块列表与搜索页面-->
                                {loop $related $t}
                                <a class="label {if $t.id==$catid}label-success{else}label-default{/if}" href="{dr_search_url($params, 'catid', $t.id)}">{$t.name}</a>
                                {/loop}
                            </p>
                            <!--调用栏目下面的商品属性筛选-->
                            {php $property = dr_mall_property($catid);}
                            {loop $property $oname $s}
                            {php $oname='mall_'.$oname}
                            <p>
                                <strong>{$s.name}：</strong>
                                <a class="label {if !strlen($params[$oname])}label-success{else}label-default{/if}" href="{dr_search_url($params, $oname, NULL)}">不限</a>
                                {loop $s.value $v $n}
                                <a class="label {if strlen($params[$oname]) && !strcmp($params[$oname], $v)}label-success{else}label-default{/if}" href="{dr_search_url($params, $oname, $v)}">{$n}</a>
                                {/loop}
                            </p>
                            {/loop}
                            <p style="line-height:30px">
                                <strong>地区搜索：</strong>
                                <a class="label {if !$get.order_city || dr_linkage('address', $get.order_city, 0, 'child')}label-success{else}label-default{/if}" href="{dr_search_url($params, 'order_city', NULL)}">不限</a>

                                <!--调用联动菜单address，pid为动态获取的地区id-->
                                {list action=linkage code=address pid=$get.order_city}
                                <a class="label {if $t.id==$get.order_city}label-success{else}label-default{/if}" href="{dr_search_url($params, 'order_city', $t.id)}">{$t.name}</a>
                                {/list}
                            </p>
                            <p style="line-height:30px">
                                <strong>价格范围：</strong>

                                <!--自定义一个租金返回数组，这个都懂得，php最基础的数组用法-->
                                {php $zujin=array('0,500'=>'500以内','500,1000'=>'500到1000','1000,2000'=>'1000到2000','2000,3000'=>'2000到3000','3000,0'=>'3000以上');}

                                <a class="label {if !$get.order_price}label-success{else}label-default{/if}" href="{dr_search_url($params, 'order_price', NULL)}">不限</a>
                                {loop $zujin $i $t}
                                <a class="label {if $i==$get.order_price}label-success{else}label-default{/if}" href="{dr_search_url($params, 'order_price', $i)}">{$t}</a>
                                {/loop}
                            </p>


                            <p style="line-height:30px">
                                <strong>排序方式：</strong>
                                <label>
                                <select class="form-control" onchange="dr_search_order(this.value)">
                                    <option {if !$params.order}selected{/if} value="">默认排序</option>
                                    <option {if $params.order == 'order_volume_desc'}selected{/if} value="order_volume_desc">销量由高到低</option>
                                    <option {if $params.order == 'order_volume_asc'}selected{/if} value="order_volume_asc">销量由低到高</option>
                                    <option {if $params.order == 'order_price_desc'}selected{/if} value="order_price_desc">价格由多到少</option>
                                    <option {if $params.order == 'order_price_asc'}selected{/if} value="order_price_asc">价格由少到多</option>
                                </select>
                                </label>
                            </p>

                            <div>
                                <div class="input-group">
                                    <input type="text" class="form-control" onkeypress="if(event.keyCode==13) {searchByClass();return false;}" name='keyword' value='{$keyword}' id='dr_search_keyword'>
                                    <span class="input-group-btn">
                                        <button class="btn blue" onclick="searchByClass()" type="button">搜索</button>
                                    </span>
                                </div>
                                <script type="text/javascript">
                                    function searchByClass(){
                                        var url="{dr_search_url($params, 'keyword', 'dayruicom')}";
                                        var value=$("#dr_search_keyword").val();
                                        if (value) {
                                            location.href=url.replace('dayruicom', value);
                                        } else {
                                            dr_tips("输入关键字");
                                        }
                                    }

                                    function dr_search_order(value) {
                                        var url="{dr_search_url($params, 'order', 'dayruicom')}";
                                        location.href=url.replace('dayruicom', value);
                                    }
                                </script>
                            </div>
                        </div>
                        <div class="row">
                            <div class="col-md-12">
                                <div class="search-container ">
                                    {if $searchid}
                                    <ul class="search-container">
                                        {list action=search module=$dirname id=$searchid order=$params.order total=$sototal catid=$catid page=1 pagesize=10 urlrule=$urlrule}
                                        <li class="search-item clearfix">
                                            <a title="{$t.title}" href="{$t.url}">
                                                <img src="{dr_thumb($t.thumb.0, 100, 90)}" width="100" height="90" style="margin-top: 15px;">
                                            </a>
                                            <div class="search-content text-left">
                                                <h4 class="search-title">
                                                    <a title="{$t.title}" href="{$t.url}">{dr_keyword_highlight($t.title, $keyword)}</a>
                                                </h4>
                                                <p>￥{$t.order_price}元，剩余{$t.order_quantity}件，已销售{$t.order_volume}件</p>

                                                <div class="search-post-foot">
                                                    <ul class="search-post-tags">
                                                        {php $kw=@explode(',', $t.keywords);}
                                                        {loop $kw $a}
                                                        {if $a}
                                                        <li class="uppercase">
                                                            <a href="{dr_tag_url(MOD_DIR, $a)}" target="_blank">{$a}</a>
                                                        </li>
                                                        {/if}
                                                        {/loop}
                                                    </ul>
                                                    <div class="search-post-meta">
                                                        <i class="icon-calendar font-blue"></i>
                                                        <a href="javascript:;">{$t.updatetime}</a>
                                                    </div>
                                                    <div class="search-post-meta">
                                                        <i class="icon-fire font-blue"></i>
                                                        <a href="javascript:;">{$t.hits}次</a>
                                                    </div>
                                                    <div class="search-post-meta">
                                                        <i class="icon-bubble font-blue"></i>
                                                        <a href="javascript:;">{$t.comments}</a>
                                                    </div>
                                                </div>
                                            </div>
                                        </li>
                                        {/list}
                                    </ul>
                                    {/if}
                                    {if !$total || !$searchid}
                                    <div style="clear: both; padding:20px; padding-bottom: 0">
                                        <div class="alert alert-danger"><strong>对不起!</strong> 没有找到任何记录 </div>
                                    </div>
                                    {/if}
                                    <div class="search-pagination">
                                        <ul class="pagination">
                                            {$pages}
                                        </ul>
                                    </div>
                                </div>
                            </div>
                        </div>
                    </div>


                </div>
            </div>
        </div>
    </div>
</div>



{template "footer.html", "/"}